	var $form = $('#toShopStatisticFrom');
	$(document).ready(function() {
		var $form_div = $("#toShopStatisticFrom div");
		winResize($form_div);
		$(window).resize(function() {// 当调整浏览器窗口的大小时，发生 resize 事件
			winResize($form_div);
		});
		tabsSelect();
		loadIntoTable();
		loadOutTable();
	});
	
	function  loadIntoTable()
	{	
		$('#intoShop_datagrid').datagrid({
			cls: "theme-datagrid",
			  singleSelect:true,  
			  rownumbers: true,
			  toolbar: '#intotb',
			  collapsible: true,
			  url: "toShopStatistic/getIntoShop",
			  queryParams: sy.serializeObject($form),
			  pagination: true,
			  pageSize: 10,
			  method: 'post'
//			  remoteSort:false,
//			  multiSort:true
		});
	}
	
	function  loadOutTable()
	{
		$('#outShop_datagrid').datagrid({
			cls: "theme-datagrid",
			  singleSelect:true,  
			  rownumbers: true,
			  toolbar: '#outtb',
			  collapsible: true,
			  url: "toShopStatistic/getOutShop",
			  queryParams: sy.serializeObject($form),
			  pagination: true,
			  pageSize: 10,
			  method: 'post'
//			  remoteSort:false,
//			  multiSort:true
		});
	}
	
	function  searchFrom()
	{
		loadIntoTable();
		loadOutTable();
	}
	
	/*tab选中事件
	 * 
	 */	
	function  tabsSelect()
	{
		 $('#toShopStatistic_tabs').tabs({  
			 	border:false,
		        onSelect:function(title){ 
		    	  if(title=="顾客转入")
		    	  {		
		    		  $('#intoShop_datagrid').datagrid("reload");
		    	  }
		    	  if(title=="顾客转出")
		    	  {		
		    		  $('#outShop_datagrid').datagrid("reload");
		    	  }
		          
		      }   
		 });
	}